package edu.cicese.alz.reports;

import org.jfree.chart.axis.SymbolAxis;
import org.jfree.chart.renderer.LookupPaintScale;

import java.awt.Color;
import java.util.List;

/**
 * Created by: Eduardo Quintana Contreras
 * Date: 6/08/12
 * Time: 01:32 PM
 */
public class FrameNFCBlock extends FrameBlock {

	public FrameNFCBlock(int userID, long startTime, List<NFCTag> nfcTags, Color colorNoData) {

		super(userID, startTime);

		title = "NFC tags - Subject: " + userID;

		paintScale = new LookupPaintScale(0.5, nfcTags.size() + 1.5, colorNoData);
		paintScale.add(0.5, colorNoData);
		String[] symbols = new String[nfcTags.size() + 1];
		symbols[0] = "";
		symbols[1] = "No Data";
		for (int i = 0; i < nfcTags.size(); i++) {
			paintScale.add(i + 1.5, nfcTags.get(i).getColor());
			symbols[i + 1] = nfcTags.get(i).getProfileCheckBox().getText();
		}

		symbolAxis = new SymbolAxis(null, symbols);
		symbolAxis.setRange(0.5, nfcTags.size() + 1.5);
	}
}